package cn.whpu.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@Controller

public class DemoController {

    @RequestMapping("/testReturnString")
    public String testReturnString(){
        return "success";
    }

    @RequestMapping("/testReturnVoid")
    public void testReturnVoid(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//        request.getRequestDispatcher("jsp/success.jsp").forward(request,response);
        response.sendRedirect("jsp/success.jsp");
    }

}
